[SUBROUTINE]
version = 1.14
icon = shcs-slot.png
name = _("SHCS CBore Slot")
type = shcs_cbore_s
help = _("<b>Creates a counterbore slot from a single point for a socket head cap screw</b>&#10;Will mill the screw slot&#10;<span foreground='blue' style='oblique'><b>Message possible in terminal window</b></span>")
order = act pv h5 x ref y h8 len rot h2 screw scr_f scr_m scr_n bore_d u_depth u_dgc h4 wd wt h3 dir st u_s dpt

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_PV]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H2]
name = _("Screw")
type = sub-header

[PARAM_H4]
name = _("Washer")
type = sub-header

[PARAM_H5]
name = _("Coords")
type = sub-header

[PARAM_H8]
name = _("Size, rotation")
type = sub-header

[PARAM_X]
name = _("X")
header = h5
type = float
icon = x.png
tool_tip = _("X reference")
value = 0
metric_value = 0.0

[PARAM_Y]
name = _("Y")
header = h5
type = float
icon = y.png
tool_tip = _("Y reference")
value = 0
metric_value = 0.0

[PARAM_REF]
name = _("X axis align")
header = h5
type = combo
options = _("End=0:Center=1")
tool_tip = _("X,Y center of slot or left end")
value = 0
icon = ref-slot-ctr.png

[PARAM_SCREW]
name = _("Select size")
type = combo-user
options = _("Fractional=1:Metric=2:Number=3")
icon = shcs.png
tool_tip = _("Select metric, fractional or numbered")
value = 1
links = scr_f=1:scr_m=2:scr_n=3
header = h2

[PARAM_SCR_F]
name = _("Fractional")
type = list
options = 1/4=31:5/16=32:3/8=33:7/16=34:1/2=35:9/16=36:5/8=37:3/4=38:7/8=39:1=10:1 1/8=41:1 1/4=42:1 1/2=43:1 3/4=44:2=45
value = 32
header = h2
hidden = 1
suffix = _("inch")

[PARAM_SCR_M]
name = _("Metric")
type = list
options = 1.6=1:2=2:2.5=3:2.6=4:3=5:4=6:5=7:6=8:8=9:10=10:12=11:14=12:16=13:18=14:20=15:24=16:30=17:36=18:42=19:48=20
value = 7
header = h2
hidden = 1
suffix = _("mm")

[PARAM_SCR_N]
name = _("Numbered screw")
type = list
options = 0=51:1=52:2=53:3=54:4=55:5=56:6=57:8=58:10=59:12=60
value = 58
header = h2
hidden = 1
prefix = #

[PARAM_BORE_D]
name = _("Counterbore depth")
type = combo-user
options = _("User defined=0:Head clears surface=1:Maximum depth=2:G-Code=3")
value = 2
icon = depth.png
tool_tip = _("Or head under surface or&#10;leave material equal to screw diameter")
header = h2
links = u_depth=0

[PARAM_U_DGC]
name = User defined depth
type = gcode
value =
header = h2
hidden = 1

[PARAM_U_DEPTH]
name = _("User defined depth")
type = float
value = -0.3
metric_value = -6
header = h2
hidden = 1

[PARAM_LEN]
name = _("Effective length")
header = h8
type = float
icon = oval-w.png
tool_tip = _("Length between center of arcs")
value = 1.0
metric_value = 25

[PARAM_ROT]
name = _("Rotation")
header = h8
type = float
digits = 2
icon = angle.png
tool_tip = _("Angle rotated")
value = 60
suffix = &#176;

[PARAM_WD]
name = _("Diameter")
header = h4
type = float
icon = washer.png
value = 0.0
metric_value = 0.0
minimum_value = 0.0
tool_tip = _("Diameter of washer used if any")
 in usual units

[PARAM_WT]
name = _("Thickness")
header = h4
type = float
icon = washer-t.png
value = 0.0
metric_value = 0.0
minimum_value = 0.0
tool_tip = _("Thickness of washer used if any")
 in usual units

[PARAM_H3]
name = _("Milling")
type = sub-header

[PARAM_DIR]
name = _("Direction")
header = h3
type = combo
options = _("Clockwise=2:Counter-Clockwise=3")
icon = cw-ccw.png
tool_tip = _("Direction of path")
value = 2

[PARAM_ST]
name = _("Cut start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_s=0:ugc=5

[PARAM_U_S]
name = _("User start")
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_USD]
name = User depth
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h3
hidden = 1

[PARAM_DPT]
name = _("Cut down to")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:G-Code=3")
icon = depth.png
tool_tip = _("Pre defined")
value = 1
header = h3
links = usd=0:ugcd=3

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content = 
	(begin #sub_name)
	(straight slot with counterbore author : Fernand Veilleux)
	
	o<#self_id_active> if [#param_act]
		o<select> CALL [31] [#param_st] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_usd] [#<bottom_through>] [#<bottom>] [#param_ugcd]
		o<select> CALL [33] [#param_bore_d] [#param_u_depth] [0] [0] [#param_u_dgc]
		
		o<shcs_size> CALL [#param_screw] [#param_scr_f] [#param_scr_m] [#param_scr_n] [#param_wd] [#param_wt] [#param_bore_d] [#33] [#31] [#<bottom>]
		
		#<len#ID> = [#param_len]
		o<select> CALL [33] [#param_ref] [#<len#ID> / 2] [0]
		#<spindle_all_time#ID> = #<_spindle_all_time>
		#<_spindle_all_time>   = 1
		o<rectangle> CALL [#param_x] [#param_y] [#<len#ID> + #<_shcs_bore_dia>] [#<_shcs_bore_dia>] [#param_rot] [#33] [0] [1] [#<_shcs_bore_dia> / 2] [0] [#param_dir] [#31] [#<_shcs_bore_depth>] [#param_pv] [0] [0]
		#<_spindle_all_time>   = #<spindle_all_time#ID>
		
		o<select> CALL [33] [#param_ref] [#<len#ID> / 2] [0]
		o<rectangle> CALL [#param_x] [#param_y] [#<len#ID> + #<_shcs_body_dia>] [#<_shcs_body_dia>] [#param_rot] [#33] [0] [1] [#<_shcs_body_dia> / 2] [0] [#param_dir] [#<_shcs_bore_depth>] [#32] [#param_pv] [0] [0]
		
	o<#self_id_active> endif
	(end #sub_name)
